<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=1000,user-scalable=no" >
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <title>激活</title>
	<script type="text/javascript" src="../lib/js/vue.js" ></script>
	<script type="text/javascript" src="../lib/js/head.js" ></script>
  <link rel="stylesheet" href="../lib/css/common.css"/>
	<link rel="stylesheet" href="../lib/css/swiper.min.css"/>
  <link rel="stylesheet" href="../lib/css/css.css"/>
</head>
<body>
<div id="mainBody" class="main_body login_bg" v-cloak>
	<div class="login_main">
		<div class="ov text_center">
			<div class="inline_block ov">
				<div class="fl login_text main_color">您还没有激活，请激活后，再使用课件系统</div>
			</div>
		</div>
		
		<div class="input_box">
			<div class="input_item">
				<div class="input_label"><span class="main_color">*</span>机构编号</div>
				<input class="input_main" v-model="shop_id" type="text" placeholder="请输入机构编号" value="" maxlength="15" />
			</div>
			<div class="input_item">
				<div class="input_label"><span class="main_color">*</span>机构激活码</div>
				<input class="input_main" v-model="password" type="text" placeholder="请输入机构激活码" value="" maxlength="20" />
			</div>
			<div class="input_item">
				<button class="input_btn" @click="clickActivateBtn" type="button">确定激活</button>
			</div>
		</div>
		
	</div>
</div>

<script type="text/javascript" src="../lib/js/jquery.min.js"></script>
<script type="text/javascript" src="../lib/js/swiper.min.js"></script>
<script type="text/javascript" src="../lib/layer/layer.js"></script>
<script type="text/javascript" src="../lib/js/login.js" ></script>
<script type="text/javascript" src="../lib/js/js.js" ></script>
<script type="text/javascript" >

var vm = new Vue({
	el: '#mainBody',
	data(){
		return{
			shop_id:'',
			password:'',
		}
	},
	mounted(){
		
	},
	methods: {
		//点击激活
		clickActivateBtn(){
			if(this.shop_id == ''){
				layer.msg('请输入机构编号');
			}else if(this.password == ''){
				layer.msg('请输入机构激活码');
			}else{
				$request({
					url:'/index.php?s=/api/user/activation/wxapp_id/10003',
					method:'post',
					data:{
						shop_id:this.shop_id,
						password:this.password
					},
					success:(res)=>{
						let userInfo = JSON.parse(sessionStorage.getItem('userInfo'));
						userInfo.is_activation = 1;
						sessionStorage.setItem('userInfo',JSON.stringify(userInfo));
						window.location.href = "./index.html"
					}
				})
			}
		},
	}
});
  
</script>
</body>
</html>